In the field of machining, there has conventionally been a demand for improvement of machining efficiency. For this purpose, a relative movement of a tool and a workpiece is controlled in the following manner, for example (see the Japanese Unexamined Patent Application Publication No. 10-63329). That is, when a tool which is moving according to an operation command comes close to a specified position, the tool begins to decelerate in order to stop at the specified position and the tool begins to accelerate toward the next specified position to move according to the next operation command. When the movement of a tool is controlled in this manner, before the movement of the tool is completed and the tool is stopped, the subsequent movement is started. Therefore, the movement time of the tool, that is, the machining time is shortened.